import request from '@/utils/request';
import { stringify } from 'qs';
export default {
    addGoodsToCart(payload) {
        return request({
            url: `/api/addGoodsToCart?${stringify(payload)}`,
            method: 'post'
        })
    },
    deleteGoodsFromCart(payload) {
        return request({
            url: `/api/deleteGoodsFromCart?${stringify(payload)}`,
            method: 'delete'
        })
    },
    deleteMoreGoodsFromCart(payload) {
        return request({
            url: `/api/deleteMoreGoodsFromCart?user_id=${payload.user_id}&goods_idList=${payload.goods_idList}`,
            method: 'delete'
        })
    },
    getGoodsInfoFromCart(payload) {
        return request({
            url: `/api/getGoodsInfoFromCart?${stringify(payload)}`,
            method: 'get'
        })
    },
    clearFailedGoods(payload) {
        return request({
            url: `/api/clearFailedGoods?user_id=${payload.user_id}&goods_idList=${payload.goods_idList}`,
            method: 'delete'
        })
    },
    addAllGoodsToCollect(payload) {
        return request({
            url: `/api/addAllGoodsToCollect?user_id=${payload.user_id}&goods_idList=${payload.goods_idList}`,
            method: 'post'
        })
    }
};